package cn.senjoeson.triper.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import cn.senjoeson.triper.bean.DayBean;
import cn.senjoeson.triper.bean.FavoriteBean;
import cn.senjoeson.triper.bean.FoodDrinkBean;
import cn.senjoeson.triper.bean.HistoryBean;
import cn.senjoeson.triper.bean.PlaceBean;
import cn.senjoeson.triper.bean.PlaceDetailBean;
import cn.senjoeson.triper.bean.Plan;

import cn.senjoeson.triper.dao.DayBeanDao;
import cn.senjoeson.triper.dao.FavoriteBeanDao;
import cn.senjoeson.triper.dao.FoodDrinkBeanDao;
import cn.senjoeson.triper.dao.HistoryBeanDao;
import cn.senjoeson.triper.dao.PlaceBeanDao;
import cn.senjoeson.triper.dao.PlaceDetailBeanDao;
import cn.senjoeson.triper.dao.PlanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig dayBeanDaoConfig;
    private final DaoConfig favoriteBeanDaoConfig;
    private final DaoConfig foodDrinkBeanDaoConfig;
    private final DaoConfig historyBeanDaoConfig;
    private final DaoConfig placeBeanDaoConfig;
    private final DaoConfig placeDetailBeanDaoConfig;
    private final DaoConfig planDaoConfig;

    private final DayBeanDao dayBeanDao;
    private final FavoriteBeanDao favoriteBeanDao;
    private final FoodDrinkBeanDao foodDrinkBeanDao;
    private final HistoryBeanDao historyBeanDao;
    private final PlaceBeanDao placeBeanDao;
    private final PlaceDetailBeanDao placeDetailBeanDao;
    private final PlanDao planDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        dayBeanDaoConfig = daoConfigMap.get(DayBeanDao.class).clone();
        dayBeanDaoConfig.initIdentityScope(type);

        favoriteBeanDaoConfig = daoConfigMap.get(FavoriteBeanDao.class).clone();
        favoriteBeanDaoConfig.initIdentityScope(type);

        foodDrinkBeanDaoConfig = daoConfigMap.get(FoodDrinkBeanDao.class).clone();
        foodDrinkBeanDaoConfig.initIdentityScope(type);

        historyBeanDaoConfig = daoConfigMap.get(HistoryBeanDao.class).clone();
        historyBeanDaoConfig.initIdentityScope(type);

        placeBeanDaoConfig = daoConfigMap.get(PlaceBeanDao.class).clone();
        placeBeanDaoConfig.initIdentityScope(type);

        placeDetailBeanDaoConfig = daoConfigMap.get(PlaceDetailBeanDao.class).clone();
        placeDetailBeanDaoConfig.initIdentityScope(type);

        planDaoConfig = daoConfigMap.get(PlanDao.class).clone();
        planDaoConfig.initIdentityScope(type);

        dayBeanDao = new DayBeanDao(dayBeanDaoConfig, this);
        favoriteBeanDao = new FavoriteBeanDao(favoriteBeanDaoConfig, this);
        foodDrinkBeanDao = new FoodDrinkBeanDao(foodDrinkBeanDaoConfig, this);
        historyBeanDao = new HistoryBeanDao(historyBeanDaoConfig, this);
        placeBeanDao = new PlaceBeanDao(placeBeanDaoConfig, this);
        placeDetailBeanDao = new PlaceDetailBeanDao(placeDetailBeanDaoConfig, this);
        planDao = new PlanDao(planDaoConfig, this);

        registerDao(DayBean.class, dayBeanDao);
        registerDao(FavoriteBean.class, favoriteBeanDao);
        registerDao(FoodDrinkBean.class, foodDrinkBeanDao);
        registerDao(HistoryBean.class, historyBeanDao);
        registerDao(PlaceBean.class, placeBeanDao);
        registerDao(PlaceDetailBean.class, placeDetailBeanDao);
        registerDao(Plan.class, planDao);
    }
    
    public void clear() {
        dayBeanDaoConfig.clearIdentityScope();
        favoriteBeanDaoConfig.clearIdentityScope();
        foodDrinkBeanDaoConfig.clearIdentityScope();
        historyBeanDaoConfig.clearIdentityScope();
        placeBeanDaoConfig.clearIdentityScope();
        placeDetailBeanDaoConfig.clearIdentityScope();
        planDaoConfig.clearIdentityScope();
    }

    public DayBeanDao getDayBeanDao() {
        return dayBeanDao;
    }

    public FavoriteBeanDao getFavoriteBeanDao() {
        return favoriteBeanDao;
    }

    public FoodDrinkBeanDao getFoodDrinkBeanDao() {
        return foodDrinkBeanDao;
    }

    public HistoryBeanDao getHistoryBeanDao() {
        return historyBeanDao;
    }

    public PlaceBeanDao getPlaceBeanDao() {
        return placeBeanDao;
    }

    public PlaceDetailBeanDao getPlaceDetailBeanDao() {
        return placeDetailBeanDao;
    }

    public PlanDao getPlanDao() {
        return planDao;
    }

}
